package com.das.exception;

/**
 * 
 * @author chihang
 * 自定义异常类的基类
 *
 */
public class BaseException extends Exception {
	
	/*
	 * 错误代码
	 */
	protected int code;
	
	/*
	 * 错误信息
	 */
	protected String msg;
	
	public BaseException(){
		super();
		this.msg = "Error.";
		this.code = 1000;
	}
	
	public BaseException(int code) {
		super();
		this.msg = "Error.";
		this.code = code;
	}
	
	public BaseException(String msg){
		super();
		this.msg = msg;
		this.code = 1000;
	}
	
	public BaseException(String msg, int code){
		super();
		this.msg = msg;
		this.code = code;
	}

	@Override
	public void printStackTrace() {
		super.printStackTrace();
	}
	
	@Override
	public String getMessage() {
		return this.msg;
	}
}
